import request from "../utils/request"
//登录
export const userLoginApi = (data)=>{
    return request({
        method:'POST',
        url: '/login',
        data
    })
}
//注册
export const userRegisterApi = (data)=>{
    return request({
        method:'POST',
        url: '/register',
        data
    })
}
//用户详情
export const userParticulars = (id)=>{
    return request({
        url: `/user/${id}`,
    })
}
//关注用户
export const userFollowsApi = (id)=>{
    return request({
        url: `/user_follows/${id}`,
    })
}
//取消关注
export const userunFollowsApi = (id)=>{
    return request({
        url: `/user_unfollow/${id}`,
    })
}
//获取关注列表
export const getUserFollowsApi = ()=>{
    return request({
        url: "/user_follows",
    })
}
//文章点赞
export const postLikeByIdsApi = (id)=>{
    return request({
        url: `/post_like/${id}`,
    })
}
//收藏和取消收藏文章
export const PostStarByIdsApi = (id)=>{
    return request({
        url: `/post_star/${id}`,
    })
}
//收藏文章列表
export const PostStarListByIdApi = ()=>{
    return request({
        url: '/user_star',
    })
}
//获取用户评论列表
export const UsercommentsListApi = ()=>{
    return request({
        url: '/user_comments',
    })
}

//发布评论
export const PostCommentApi = (id,data)=>{
    return request({
        method:'POST',
        url: `/post_comment/${id}`,
        data
    })
}